{include file='public:header-css'/}
<body>
<div class="lyear-layout-web">
  <div class="lyear-layout-container">
    <!--左侧导航-->
    {include file='public:left-menu'/}
    <!--End 左侧导航-->
    <!--头部信息-->
    {include file='public:nav-header' title="商品管理" subTitle="商品评论"/}
    <!--End 头部信息-->
    <!--页面主要内容-->
    <main class="lyear-layout-content">
      <div class="container-fluid">
        <div class="row">
          <div class="col-lg-12">
            <div class="card">
              <div class="hint">
                <div class="hint-info">
                  <h5><i class="mdi mdi-help-circle-outline"></i>操作提示</h5>
                  <p>平台商品评论列表</p>
                </div>
              </div>
              <div class="card-toolbar">
                <div class="card-toolbar-center">
                  <a href="" class="table-btn btn-dark"><i class="mdi mdi-replay"></i></a>
                  <button class="table-btn btn-theme">共{$list->total()}条记录 当前第{$list->currentPage()}页</button>
                </div>
                <form class="table-form" method="post" action="">
                  <div class="table-form-group">
                    <input data-type="time" readonly id="start_time" name="start_time" type="text" value="{$start_time}">
                    <button class="btn btn-default" type="button">开始时间</button>
                  </div>
                  <div class="table-form-group">
                    <input data-type="time" name="end_time" id="end_time" type="text" value="{$end_time}" readonly>
                    <button class="btn btn-default" type="button">结束时间</button>
                  </div>
                  <div class="table-form-group">
                    {assign name="search_type" value="$Request.param.search_type|default='mobile'" /}
                    <select name="search_type" class="input-group-select">
                      <option value="mobile" {if $search_type=='mobile'}selected{/if}>手机号码</option>
                      <option value="realname" {if $search_type=='realname'}selected{/if}>真实姓名</option>
                    </select>
                    <input type="text" value="{$Request.param.search_key}" name="search_key"
                           placeholder="查询">
                    <button class="btn btn-default" onclick="submit1()" type="button">搜索</button>
                  </div>
                </form>
              </div>
              <div class="card-body">
                <div class="table-responsive">
                  <table class="table table-bordered table-striped table-hover">
                    <thead>
                    <tr>
                      <th>编号</th>
                      <th>手机号码</th>
                      <th>真实姓名</th>
                      <th>商品名称</th>
                      <th>店铺名称</th>
                      <th>评论图片</th>
                      <th>评论内容</th>
                      <th>描述相符</th>
                      <th>商品满意度</th>
                      <th>创建时间</th>
                    </tr>
                    </thead>
                    <tbody>
                    {if $list->isEmpty()}
                    <tr>
                      <td class="no-data" colspan="50">
                        <i class="mdi mdi-alert-decagram"></i>没有符合条件的记录
                      </td>
                    </tr>
                    {else/}
                    {volist name="$list" id="vo"}
                    <tr>
                      <td>{$vo[$vo.pk]}</td>
                      <td><a href="{:url('User/detail',['user_id'=>$vo.user.user_id])}">{$vo.user.mobile}</a></td>
                      <td>{$vo.user.realname}</td>
                      <td>{$vo.goods.goods_name}</td>
                      <td>{$vo.store.store_name}</td>
                      <td class="img">
                        {if $vo.img}
                        {volist name="$vo.img" id="img"}
                        <img title="点击图片看大图" data-toggle="tooltip" class="table-img" src="{$img}">
                        {/volist}
                        {else/}
                        无
                        {/if}
                      </td>
                      <td>
                        <a href="javascript:;" data-text="{$vo.content}" onclick="look(this)"><i class="mdi mdi-eye-outline"></i>查看</a>
                      </td>
                      <td>
                        {for start='0' end='5'}
                        <i class="mdi mdi-star {if $i<$vo.describe_score}text-theme{/if}"></i>
                        {/for}
                      </td>
                      <td>
                        {for start='0' end='5'}
                        <i class="mdi mdi-star {if $i<$vo.goods_rank}text-theme{/if}"></i>
                        {/for}
                      </td>
                      <td>{$vo.add_time}</td>
                    </tr>
                    {/volist}
                    {/if}
                    </tbody>
                  </table>
                </div>
                <!--分页-->
                <div class="page">
                  {$page|raw}
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </main>
    <!--End 页面主要内容-->
  </div>
</div>
<style>
  .mdi-star{
    font-size: 16px;
  }
</style>
<!--日期选择插件-->
<script src="__STATIC__/plugin/laydate/laydate/laydate.js"></script>
<script type="text/javascript">
  layer.photos({
    photos: '.img'
    ,anim: 5
  });
  $(function(){
    $('#start_time').layDate();
    $('#end_time').layDate();
  });
  //回车提交
  $(document).keyup(function(event){
    if(event.keyCode ==13){
      submit1();
    }
  });
  function submit1() {
    var url="{:url('Goods/goods_comment_list')}";
    $('.table-form').attr('action',url).submit();
  }
  function look(obj) {
    var content=$(obj).attr('data-text');
    $.confirm({
      // boxWidth:'50%',
      // useBootstrap: false,
      columnClass: 'large',
      title: '评论内容',
      content: '' +
              '<form action="" class="formName">' +
              '<div class="form-group">' +
              '<p>'+content+'</p>' +
              '</div>' +
              '</form>',
      buttons: {
        cancel: {
          btnClass: 'btn-theme',
          text: '确定'
        },
      }
    });
  }
</script>
</body>
</html>